/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.udesc.db;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author anderson
 */
@Entity
@Table(name = "cheques_emitidos")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ChequesEmitidos.findAll", query = "SELECT c FROM ChequesEmitidos c"),
    @NamedQuery(name = "ChequesEmitidos.findById", query = "SELECT c FROM ChequesEmitidos c WHERE c.id = :id"),
    @NamedQuery(name = "ChequesEmitidos.findByNumero", query = "SELECT c FROM ChequesEmitidos c WHERE c.numero = :numero"),
    @NamedQuery(name = "ChequesEmitidos.findByTipoCheque", query = "SELECT c FROM ChequesEmitidos c WHERE c.tipoCheque = :tipoCheque"),
    @NamedQuery(name = "ChequesEmitidos.findByDataEmissao", query = "SELECT c FROM ChequesEmitidos c WHERE c.dataEmissao = :dataEmissao"),
    @NamedQuery(name = "ChequesEmitidos.findByDataDesconto", query = "SELECT c FROM ChequesEmitidos c WHERE c.dataDesconto = :dataDesconto"),
    @NamedQuery(name = "ChequesEmitidos.findByValor", query = "SELECT c FROM ChequesEmitidos c WHERE c.valor = :valor"),
    @NamedQuery(name = "ChequesEmitidos.findByObservacao", query = "SELECT c FROM ChequesEmitidos c WHERE c.observacao = :observacao"),
    @NamedQuery(name = "ChequesEmitidos.findByDespesa", query = "SELECT c FROM ChequesEmitidos c WHERE c.despesa = :despesa"),
    @NamedQuery(name = "ChequesEmitidos.findByDataCadastramento", query = "SELECT c FROM ChequesEmitidos c WHERE c.dataCadastramento = :dataCadastramento"),
    @NamedQuery(name = "ChequesEmitidos.findByDataModificacao", query = "SELECT c FROM ChequesEmitidos c WHERE c.dataModificacao = :dataModificacao"),
    @NamedQuery(name = "ChequesEmitidos.findByFundo", query = "SELECT c FROM ChequesEmitidos c WHERE c.fundo = :fundo"),
    @NamedQuery(name = "ChequesEmitidos.findByBaixado", query = "SELECT c FROM ChequesEmitidos c WHERE c.baixado = :baixado")})
public class ChequesEmitidos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "numero")
    private int numero;
    @Basic(optional = false)
    @NotNull
    @Column(name = "tipo_cheque")
    private Character tipoCheque;
    @Basic(optional = false)
    @NotNull
    @Column(name = "data_emissao")
    @Temporal(TemporalType.DATE)
    private Date dataEmissao;
    @Column(name = "data_desconto")
    @Temporal(TemporalType.DATE)
    private Date dataDesconto;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "valor")
    private BigDecimal valor;
    @Size(max = 200)
    @Column(name = "observacao")
    private String observacao;
    @Column(name = "despesa")
    private Boolean despesa;
    @Basic(optional = false)
    @NotNull
    @Column(name = "data_cadastramento")
    @Temporal(TemporalType.DATE)
    private Date dataCadastramento;
    @Column(name = "data_modificacao")
    @Temporal(TemporalType.DATE)
    private Date dataModificacao;
    @Column(name = "fundo")
    private Boolean fundo;
    @Column(name = "baixado")
    private Boolean baixado;
    @JoinColumn(name = "fornecedor", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Fornecedores fornecedor;
    @JoinColumn(name = "banco", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Bancos banco;

    public ChequesEmitidos() {
    }

    public ChequesEmitidos(Integer id) {
        this.id = id;
    }

    public ChequesEmitidos(Integer id, int numero, Character tipoCheque, Date dataEmissao, Date dataCadastramento) {
        this.id = id;
        this.numero = numero;
        this.tipoCheque = tipoCheque;
        this.dataEmissao = dataEmissao;
        this.dataCadastramento = dataCadastramento;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getNumero() {
        return numero;
    }

    public void setNumero(int numero) {
        this.numero = numero;
    }

    public Character getTipoCheque() {
        return tipoCheque;
    }

    public void setTipoCheque(Character tipoCheque) {
        this.tipoCheque = tipoCheque;
    }

    public Date getDataEmissao() {
        return dataEmissao;
    }

    public void setDataEmissao(Date dataEmissao) {
        this.dataEmissao = dataEmissao;
    }

    public Date getDataDesconto() {
        return dataDesconto;
    }

    public void setDataDesconto(Date dataDesconto) {
        this.dataDesconto = dataDesconto;
    }

    public BigDecimal getValor() {
        return valor;
    }

    public void setValor(BigDecimal valor) {
        this.valor = valor;
    }

    public String getObservacao() {
        return observacao;
    }

    public void setObservacao(String observacao) {
        this.observacao = observacao;
    }

    public Boolean getDespesa() {
        return despesa;
    }

    public void setDespesa(Boolean despesa) {
        this.despesa = despesa;
    }

    public Date getDataCadastramento() {
        return dataCadastramento;
    }

    public void setDataCadastramento(Date dataCadastramento) {
        this.dataCadastramento = dataCadastramento;
    }

    public Date getDataModificacao() {
        return dataModificacao;
    }

    public void setDataModificacao(Date dataModificacao) {
        this.dataModificacao = dataModificacao;
    }

    public Boolean getFundo() {
        return fundo;
    }

    public void setFundo(Boolean fundo) {
        this.fundo = fundo;
    }

    public Boolean getBaixado() {
        return baixado;
    }

    public void setBaixado(Boolean baixado) {
        this.baixado = baixado;
    }

    public Fornecedores getFornecedor() {
        return fornecedor;
    }

    public void setFornecedor(Fornecedores fornecedor) {
        this.fornecedor = fornecedor;
    }

    public Bancos getBanco() {
        return banco;
    }

    public void setBanco(Bancos banco) {
        this.banco = banco;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ChequesEmitidos)) {
            return false;
        }
        ChequesEmitidos other = (ChequesEmitidos) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.udesc.db.ChequesEmitidos[ id=" + id + " ]";
    }
    
}
